fix(web): allow closing diff panel in non-git projects#2413
fix(web): allow closing diff panel in non-git projects#2413juliusmarminge merged 1 commit intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved Simple UI bug fix that adds a condition to allow closing an already-open diff panel in non-git projects. The change is minimal, self-contained, and has clear intent with no side effects. You can customize Macroscope's approvability policy. Learn more. |
What Changed
Why
If you open the diff panel in a git-backed project and then switch to an already existing thread whose project does not have git, the panel stays open but the header toggle becomes disabled. That traps the panel in an open state.
Opening a new thread already closes the diff panel properly. The broken case is specifically switching to another existing thread where the diff panel remains open across navigation.
This fix stays small and local to the header control: if the panel is currently enabled, it must also be possible to disable it.
Related to #937, but this is a different close-path regression.
Note
Low Risk
Small, localized UI-state change to toggle/tooltip gating; no backend, data, or security impact.
Overview
Fixes a UI trap where the diff panel could remain open after switching to a non-git project by keeping the diff toggle enabled while
diffOpenis true.Updates the tooltip logic to only show the “not a git repository” message when the panel is closed, allowing users to close the diff panel even when
isGitRepois false.Reviewed by Cursor Bugbot for commit 2e3d5bd. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix diff panel toggle to allow closing in non-git projects
In ChatHeader.tsx, the diff toggle button was always disabled for non-git repos, trapping users with an open diff panel they couldn't close. The disabled condition and tooltip now check both
!isGitRepoand!diffOpen, so the toggle stays enabled when the panel is open regardless of git status.Macroscope summarized 2e3d5bd.